package com.hudilao.controller;

import com.hudilao.common.R;
import com.hudilao.entity.Dish;
import com.hudilao.service.RecommendationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user/recommendation")
public class RecommendationController {

    @Autowired
    private RecommendationService recommendationService;

    /**
     * 基于用户协同过滤，获取一道推荐菜品
     * @return
     */
    @GetMapping("/dish")
    public R<Dish> getRecommendedDish(){
        Dish recommendedDish = recommendationService.getRecommendDish();
        return R.success(recommendedDish);
    }
}
